﻿using Microsoft.AspNetCore.Mvc;
using ServiceCore.Entity.Core;
using ServiceCore.Entity.Model;
using ServiceCore.Service.Common;
using ServiceCore.WebApi.jwt;

namespace ServiceCore.WebApi.Controllers
{
    /// <summary>
    /// 枚举
    /// </summary>
    [Route("Api/[controller]/[action]")]
    [ApiController]
    public class EnumController : ApiJwtController
    {
        private EnumService enumService = new EnumService();

        /// <summary>
        /// 列表
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<EnumInfo, List<EnumInfo>> List(BaseParam<EnumInfo, List<EnumInfo>> arg)
        {
            arg = enumService.Enum_List(arg);

            return arg;
        }

        /// <summary>
        /// 类型列表
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<string, List<EnumInfo>> TypeList(BaseParam<string, List<EnumInfo>> arg)
        {
            arg = enumService.Enum_TypeList(arg);

            return arg;
        }

        /// <summary>
        /// 初始化
        /// </summary>
        /// <arg name="arg"></arg>
        /// <returns></returns>
        [HttpPost]
        public BaseParam<EnumInfo, bool> Init(BaseParam<EnumInfo, bool> arg)
        {
            arg = enumService.Enum_Init(arg);

            return arg;
        }
    }
}
